package org.kolonitsky.css.runner.cli;

import com.beust.jcommander.JCommander;
import org.kolonitsky.css.runner.Runner;
import org.kolonitsky.css.runner.Settings;

/**
 * @author Alex.Kolonitsky
 */
public class CliRunner extends Runner {

    private static JCommander jCommander = new JCommander(new CliSettings());

    public CliRunner(Settings settings) {
        super(settings);
    }

    public static void main(String[] args) {
        try {
            jCommander.parse(args);
        } catch (Exception e) {
            System.out.println(e.getMessage());
            jCommander.usage();
        }

        CliRunner runner = new CliRunner((Settings) jCommander.getObjects().get(0));
        runner.run();
    }
}
